package com.accp.vehiclecare.biz.syhbiz;

import com.accp.vehiclecare.dao.syhdao.IRbprojectDao;
import com.accp.vehiclecare.pojo.Rbproject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RbprojectBiz {

    @Resource
    private IRbprojectDao dao;

    @Transactional(propagation = Propagation.REQUIRED)
    public boolean addRbproject(Rbproject rbproject){
        return dao.insert(rbproject) > 0;
    }


    public List<Rbproject> queryRbproject(String billNo){
        QueryWrapper qw = Wrappers.query();
        qw.eq("repairbillsno",billNo);
        return dao.selectList(qw);
    }

    public void removeXm(int id){
        dao.deleteById(id);
    }
}
